﻿using MediatR;
using T.Personnel.API.Application.Command.ResignationManageCommand;
using T.Personnel.Repository.Interface;

namespace T.Personnel.API.Application.CommandHandler.ResignationManageHandler
{
    public class AddResignationManageHandler : IRequestHandler<AddResignationManageCommand, int>
    {
        private readonly IManageRepository manageRepository;

        public AddResignationManageHandler(IManageRepository manageRepository)
        {
            this.manageRepository = manageRepository;
        }

        public async Task<int> Handle(AddResignationManageCommand request, CancellationToken cancellationToken)
        {
            return await manageRepository.AddResignationAsync(request);
        }
    }
}
